<template>
  
      <div>
        <van-row>
            <van-col span="24"><myheader/></van-col>
            <van-col span="6"><myleft/></van-col>
            <van-col span="18">
            <van-row>

            </van-row>
            <van-row>
                <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" />
                <van-uploader :after-read="upload"/>
            </van-row>
            </van-col>
        </van-row>
  </div>
  
</template>

<script>
import axios from 'axios'
import myheader from '../comm/myheader.vue'
import myleft from '../comm/myleft.vue'
export default {
  data() {
    return {
      data: [
        {
          label: 'Level one 1',
          children: [
            {
              label: 'Level two 1-1',
              children: [
                {
                  label: 'Level three 1-1-1',
                },
              ],
            },
          ],
        },
        {
          label: 'Level one 2',
          children: [
            {
              label: 'Level two 2-1',
              children: [
                {
                  label: 'Level three 2-1-1',
                },
              ],
            },
            {
              label: 'Level two 2-2',
              children: [
                {
                  label: 'Level three 2-2-1',
                },
              ],
            },
          ],
        },
        {
          label: 'Level one 3',
          children: [
            {
              label: 'Level two 3-1',
              children: [
                {
                  label: 'Level three 3-1-1',
                },
              ],
            },
            {
              label: 'Level two 3-2',
              children: [
                {
                  label: 'Level three 3-2-1',
                },
              ],
            },
          ],
        },
      ],
      defaultProps: {
        children: 'children',
        label: 'label',
      },
    }
  },
  methods: {
    handleNodeClick(data) {
      console.log(data)
    },
    upload(file){
            let formData = new FormData()
            formData.append('file',file.file)
            axios({url:'upload',method:'post',data:formData}).then(res=>{
                console.log(res)
            })

        }
  },
  components:{
        'myheader':myheader,
        'myleft':myleft
    },
}
</script>
<style scoped>

</style>